import { request } from '../request';

/** get constant routes */
export function fetchGetConstantRoutes() {
  return request<Api.Route.MenuRoute[]>({ url: '' });
}

/** get user routes */
export function fetchGetUserRoutes() {
  return request<Api.Route.UserRoute>({ url: '/adminapi/admin/menu?is_tree=1' });
}



export function getSubmitParams(item) {
  return request({
    url: '/adminapi/rule/add',
    method: 'post',
    data:item
  });
}

export function deleteMenu(id: number) {
  return request({
    url: `/adminapi/rule/del?ids=${id}`,
    method: 'get',
  });
}

export function getUpdateParams(item) {
  return request({
    url: '/adminapi/rule/edit',
    method: 'post',
    data: item,
  });
}